home *** CD-ROM | disk | FTP | other *** search
/ Web Star/List Star - Eve…he Ultimate Internet Site / StarNine Internet Pubisher (Web Star and List Star)(StarNine)(1995).iso / ListSTAR™ / Tools and Enhancments / Paging with ListSTAR / Notify! / Notify! Send Page v1.0 < prev    next >
Text File  |  1995-08-04  |  3KB  |  75 lines

  1. -----------------------------------------------------------------------
  2. -- StarNine Technologies, Inc., hereby disclaims all copyright interest
  3. -- in the following source code written by Joshua D. Baer.
  4. -- 
  5. -- This source code is free and has been placed into the public domain.
  6. -- You can redistribute it, modify it (including these comments) and/or
  7. -- create derivative works from it as you see fit.
  8. --
  9. -- This source code is made available in the hope that it will be useful,
  10. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. -----------------------------------------------------------------------
  13.  
  14. --DEBUG
  15. --tell application "ListSTAR Server" to set s9SenderEmailAddress to {FreeFormName:"Joshua D. Baer", EMailAddress:"josh@starnine.com"} as StarNineAddress
  16. --set s9mailsubject to "Doug Walner"
  17.  
  18. --Place this script in the folder with the same name as the service you just created
  19. --(ie. Hard Drive->ListSTAR/SMTP->Services-><Service Name>).
  20. --Change the value for the ServiceName variable to be the same as the name of your Service.
  21.  
  22. set ServiceName to "<your Service Name>"
  23.  
  24. --End of Configuration Area
  25.  
  26. set intro to "Sending page to: "
  27. set bodyintro to "Body: "
  28. --max length of pages
  29. set maxlength to 240
  30.  
  31. --the file which contains the body of the page
  32. set strStart to path to me
  33. set strListSTARpath to text from character 1 to character -16 of (strStart as string)
  34. set thefile to strListSTARpath & "Services:" & ServiceName & ":Outgoing Page"
  35. --the email address of the server
  36. set serviceEmailAddress to "notify@thelorax.starnine.com"
  37.  
  38. tell application "Notify!™ Server"
  39.     
  40.     --DEBUG CODE
  41.     tell application "ListSTAR Server"
  42.         StarNine Log "constructing page" Log Level Debug
  43.     end tell
  44.     
  45.     --read in body of message
  46.     try
  47.         set textsource to open for access file (thefile) --open the file with the digest in it
  48.         set thetext to read textsource from 1 -- read the entire file into theBody
  49.         close access textsource --close the file
  50.     on error errString number errNum
  51.         return -1
  52.         display dialog errString & " " & errNum
  53.     end try
  54.     
  55.     --check to see if body is too long, if so truncate
  56.     set theheader to (count of characters in (intro & s9mailsubject & bodyintro)) + 1
  57.     if ((count of characters in thetext) + theheader) is greater than maxlength then set thetext to (characters 1 through (maxlength - theheader) of thetext)
  58.     
  59.     --if subscriber is known, page him
  60.     if ((s9mailsubject is in (DoScript "Get Subscribers")) or (s9mailsubject is in (DoScript "Get Groups"))) then
  61.         tell application "ListSTAR Server"
  62.             StarNine Log "sending page" Log Level Debug
  63.         end tell
  64.         Page s9mailsubject as string Message thetext as string
  65.     else --else subscriber is not known, so reply and say so
  66.         tell application "ListSTAR Server"
  67.             StarNine Send ¬
  68.                 "Notify!" To s9SenderEmailAddress ¬
  69.                 Subject s9mailsubject & ¬
  70.                 " is not a known subscriber or group" Body s9mailsubject & " is not a known subscriber or group.  For a complete listing, send mail to \"" & serviceEmailAddress & "\" with the word \"subscribers\" in the subject." & return & return & "Original text of page follows:" & return & return & thetext
  71.         end tell
  72.     end if
  73. end tell
  74.  
  75. return 0